﻿namespace SPFluid.Core.Validation.Extensions
{
    public static class NullableValidatorExtensions
    {
        public static IGuard<T?> IsNotNull<T>(this IGuard<T?> guard)
            where T : struct
        {
            if (!guard.Argument.Value.HasValue)
            {
                guard.ExceptionHandler.ThrowArgumentNullException();
            }

            return guard;
        }
    }
}